<template>
	<view class="tabs">
		<view class="page-section-spacing">
			<scroll-view lower-threshold="500" class="" :refresher-triggered=refresherTriggered :refresherThreshold=refresherThreshold
				 refresher-background="#FFFFFF"  @scrolltolower='nextPage()'
				scroll-y :style="{height: orderHeight+'px'}">
				<view class="null box-c d-jc-c d-ai-c" v-if="isShow">
					<image class="mt-5" src="../../static/images/activity/shenqing@2x.png" mode=""></image>
					<text class="mt-3">您暂时还没报名任何团队~</text>
				</view>
				<view class="all-box" v-if="!isShow">
					<view class="pannel" v-for="(item,index) in checkList" :key="index">
						<view class="applyname">
							<view class="">
								申请时间：{{item.createTime}}
							</view>
							<view class="" v-if="item.status===-1">
								正在审核中
							</view>
							<view class="" v-if="item.status===1">
								正常
							</view>
							<view class="" v-if="item.status===2">
								拒绝
							</view>
						</view>
						<view class="">
							<view class="casetype">
								<view class="">
									团队类型：
								</view>
								<view class="" v-if="item.type===1">
									文艺团队
								</view>
								<view class="" v-if="item.type===2">
									光盘互助
								</view>			
							</view>
											
						</view>
						<view class="">
							<view class="casetype">
								<view class="">
									团队名称：
								</view>
								<view class="">
									{{item.name}}
								</view>
					
							</view>
					
						</view>
						<view class="case">
							<view class="">
								团队口令：
							</view>
							<view class="">
								{{item.password}}
							</view>
					
						</view>
					</view>
					
				</view>
			</scroll-view>
		</view>
	</view>
</template>

<script>
	import uQRCode from '@/js_sdk/Sansnn-uQRCode/uqrcode.js'
	export default {
		data() {
			return {
				checkList:'',
				orderHeight: 500,
				hasNextPage: true,
				pageNum: 1,
				pageSize: 10,
				LeaveLog:'',
				hasNextPage: true,
				refresherThreshold: 50,
				refresherTriggered: false,
				_refresherTriggered: false,
				isShow:false
			}
		},
		onReady() {
			let that = this;
			uni.getSystemInfo({ //调用uni-app接口获取屏幕高度
				success(res) { //成功回调函数
					that.orderHeight = res.windowHeight //windoHeight为窗口高度，主要使用的是这个
				}
			})
		},

		onLoad() {
			this.applyrecord()
		},
		methods: {
			nextPage() {
				console.log("====出发底部===")
				console.log("====出发底部===" + this.pageNum)
				console.log("====出发底部===" + this.hasNextPage)
				if (this.hasNextPage) {
					this.pageNum = this.pageNum + 1
					console.log(this.pageNum)
					this.$api.applyrecord({
					},this.pageNum, this.pageSize).then((res) => {
						if (res.data.code == 200) {
							console.log(res.data)
							this.checkList = res.data.dataMap.list
							this.hasNextPage = res.data.dataMap.hasNextPage
						}
					})
				}
				
			
			},
			// 时间转换
			renderTime(date) {
				var dateee = new Date(date).toJSON();
				return new Date(+new Date(dateee) + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/,
					'')
			},
			//活动审核列表
			applyrecord(){
				this.$api.applyrecord({
					},this.pageNum, this.pageSize).then((res)=>{
					this.checkList = res.data.dataMap.list
					this.hasNextPage = res.data.dataMap.hasNextPage
					if(this.checkList.length<1){
						this.isShow=true
					}else{
						this.isShow=false
					}
				})
				
			},
		}
	}
</script>

<style scoped>
	.null>image {
			width: 340rpx;
			height: 340rpx;	
		}	
	.null>text{
			color: #8b8b8b;
		}
	
	.apply_time{
		height: 70rpx;
		line-height: 70rpx;
		font-size: 22rpx;
		font-weight: 500;
		color: #999999;
	}
	.all-box{
		overflow: hidden;
	}
	.applyname {
		display: flex;
		align-items: center;
		justify-content: space-between;
	}
	.applyname>view:nth-child(1){
		font-size: 26rpx;
		font-weight: 500;
		color: #999999;
	}
	.line_l {
		width: 690rpx;
		height: 2rpx;
		background-color: #EEEEEE;
		margin: 0 auto;
		margin-top: 20rpx;
	}

	.casetype {
		display: flex;
		margin-top: 20rpx;
	}

	.casetype>view:nth-child(1) {
		width: 158rpx;
		line-height: 36rpx;
		font-weight: 500;
		font-size: 26rpx;
		color: #333333;
	}

	.casetype>view:nth-child(2) {
		width: 606rpx;
		line-height: 36rpx;
		font-weight: 500;
		font-size: 26rpx;
		color: #333333;
	}

	.case {
		display: flex;
		margin-top: 16rpx;
	}

	.case>view:nth-child(1) {
		width: 158rpx;
		line-height: 36rpx;
		font-weight: 500;
		font-size: 26rpx;
		color: #333333;
	}

	.case>view:nth-child(2) {
		width: 606rpx;
		line-height: 36rpx;
		font-weight: 500;
		font-size: 26rpx;
		color: #333333;
	}

	.pannel {
		width: 690rpx;
		background-color: #FFFFFF;
		padding: 30rpx 30rpx 30rpx 30rpx;
		color: #333333;
		font-size: 24rpx;
		margin-top: 20rpx;
	}

	.page-section-spacing {
		background-color: #f3f3f3;
		display: flex;
		justify-content: space-around;
	}

	.line {
		height: 8rpx;
		background-color: #FF5551;
		width: 50%;
		margin: auto;
		border-radius: 50rpx;
		margin-top: 5rpx;
	}

	.line-gray {
		height: 1rpx;
		width: 660rpx;
		background-color: #f0f0f0;
		margin: auto;
		border-radius: 24rpx;
		z-index: 99;
	}

	.scroll-view_H {
		white-space: nowrap;
		width: 90%;

	}

	.scroll-view-item_H>view {
		font-size: 33rpx;
		/* border: 1px solid red; */
		line-height: 80rpx;

	}

	.scroll-view-item_H {
		display: inline-block;
		width: 150rpx;
		height: 75rpx;

		text-align: center;
		font-size: 34rpx;
		/* border: 1px solid red; */
		/* margin-left: 28rpx; */
	}

	,
	.tab-bar {
		/* #ifdef APP-PLUS */
		width: 750rpx;
		/* #endif */
		height: 42px;
		flex-direction: row;
		/* #ifndef APP-PLUS */
		white-space: nowrap;
		/* #endif */
	}

	,
	.tabs {
		flex: 1;
		flex-direction: column;
		background-color: #ffffff;
	}

	.active {
		color: #a7a7a7;
	}

	.casetype1 {
		display: flex;
		margin-top: 12rpx;
	}

	.casetype1>view:nth-child(1) {
		width: 158rpx;
		line-height: 36rpx;
		font-weight: 500;
		color: #666666;
	
	}

	.casetype1>view:nth-child(2) {
		width: 606rpx;
		line-height: 36rpx;
		font-weight: 500;
		color: #666666;
	}

	.case1 {
		display: flex;
		margin-top: 16rpx;
	}

	.case1>view:nth-child(1) {
		width: 158rpx;
		line-height: 36rpx;
		font-weight: 500;
		color: #666666;
	}

	.case1>view:nth-child(2) {
		width: 606rpx;
		line-height: 36rpx;
		font-weight: 500;
		color: #666666;
	}

	.pannel1 {
		width: 690rpx;
		background-color: #FFFFFF;
		padding: 30rpx 30rpx 30rpx 30rpx;
		margin-top: 20rpx;
	}

	.applyname>view:nth-child(2) {
		font-size: 26rpx;
		font-weight: bold;
		color: #FF7E51;
	}
</style>
